package com.example.aop.invocation;

import org.springframework.web.servlet.HandlerInterceptor;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class JDKinvocaion implements InvocationHandler {

    private Object object;

    public JDKinvocaion(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("我是中介，开始代理");
        Object invoke = method.invoke(object);
        System.out.println("我是中介，结束代理");
        return invoke;
    }
}
